package org.example.memora.mapper;

import org.example.memora.entity.CommentLike;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentLikeMapper {

    /**
     * 根据 userId + commentId 查询一条点赞记录
     */
    CommentLike selectByUserAndComment(@Param("userId") Long userId,
                                       @Param("commentId") String commentId);

    /**
     * 新增点赞记录
     */
    int insertLike(CommentLike commentLike);

    /**
     * 删除某个用户对某个评论的点赞记录
     */
    int deleteLike(@Param("userId") Long userId,
                   @Param("commentId") String commentId);

    int batchInsert(List<CommentLike> records);
}
